package com.bjpowernode.dataservice.service;

import com.bjpowernode.api.dto.UserBidInfo;
import com.bjpowernode.api.serivce.BidInfoService;
import com.bjpowernode.api.serivce.PlatformService;
import com.bjpowernode.dataservice.mapper.BidInfoMapper;
import com.bjpowernode.util.CommonUtils;
import org.apache.dubbo.config.annotation.DubboService;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 麦翔盛
 * @ClassName: BidInfoServiceImpl
 * @Package: com.bjpowernode.dataservice.service
 * @description: 投资记录
 * @date 2022/5/19 23:58
 */
@DubboService(interfaceClass = BidInfoService.class,version = "1.0")
public class BidInfoServiceImpl implements BidInfoService{
    @Resource
    private BidInfoMapper bidInfoMapper;

    @Override
    public List<UserBidInfo> selectByProdId(Integer pid, Integer pageNo, Integer pageSize) {
        //计算分页
        pageNo = (CommonUtils.getDefPageNo(pageNo) - 1) * pageSize;
        pageSize = CommonUtils.getDefPageSize(pageSize);
        return bidInfoMapper.selectByProdId(pid, pageNo, pageSize);
    }
}
